<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">过程报警</h4>
</div>
<form id="defaultForm" method="post" class="form-horizontal" action="/project/indexManage/warn_save">
    <div class="modal-body">
      <input name="id"  style="display: none" th:value="${alarmInfo.id}">
        <div class="form-group">
            <label class="col-lg-3 control-label">编号</label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="code" th:value="${alarmInfo.code}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">名称</label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="name" th:value="${alarmInfo.name}" />
            </div>
        </div>


        <div class="form-group">
            <label class="col-lg-3 control-label">适用对象</label>
            <div class="col-lg-6">
                <select class="form-control" name="objName">
                    <option th:each="parameter:${objects}" th:value="${parameter.remark}" th:text="${parameter.name}"
                            th:selected="${parameter.remark eq alarmInfo.objName + ''}"></option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label class="col-lg-3 control-label">所属类别</label>
            <div class="col-lg-6">
                <select class="form-control" name="objType">
                    <option th:each="parameter:${objTypes}" th:value="${parameter.id}"
                            th:text="${parameter.name}" th:selected="${parameter.id eq alarmInfo.objType}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">来源</label>
            <div class="col-lg-6">
                <select class="form-control" name="source">
                    <option th:each="parameter:${sources}" th:value="${parameter.remark}" th:text="${parameter.name}"
                    th:selected="${parameter.remark eq alarmInfo.source + ''}">
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">报警等级</label>
            <div class="col-lg-6">
                <select class="form-control" name="alarmLev">
                    <option th:each="parameter:${alarmLev}" th:value="${parameter.id}" th:text="${parameter.name}"
                            th:selected="${parameter.id eq alarmInfo.alarmLev}">
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">建议处理方式</label>
            <div class="col-lg-6">
                <select class="form-control" name="manageWay">
                    <option th:each="parameter:${mode}" th:value="${parameter.id}" th:text="${parameter.name}"
                    th:selected="${parameter.id eq alarmInfo.manageWay}">
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">是否记录SOE</label>
            <div class="col-lg-6">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="isRecordSoe" th:value="${alarmInfo.isRecordSoe}" th:checked="${alarmInfo.isRecordSoe}"  onclick="this.value=(this.value==0)?1:0">
                    </label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">SOE前后时长(秒/s)</label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="soeDuration" th:value="${alarmInfo.soeDuration}"/>
            </div>
        </div>
        </div>

        <div class="form-group">
            <label class="col-lg-3 control-label">是否展示</label>
            <div class="col-lg-6">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="isShow" th:value="${alarmInfo.isShow}" th:checked="${alarmInfo.isShow}" onclick="this.value=(this.value==0)?1:0">
                    </label>
                </div>
            </div>
        </div>

    <div class="form-group">
        <label class="col-lg-3 control-label">关联测点</label>
        <div class="col-lg-6">
            <select class="form-control" name="parameterCode">
                <option th:each="parameter:${pcode}"  th:text="${parameter}"
                        th:selected="${parameter eq alarmInfo.parameterCode}">
            </select>
        </div>
    </div>
    </div>

    <div class="form-group">
        <label class="col-lg-3 control-label">运算符</label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="operator" th:value="${alarmInfo.operator  }"/>
            </div>
    </div>

    <div class="form-group">
        <label class="col-lg-3 control-label">关联阈值</label>
        <div class="col-lg-6">
            <select class="form-control" name="thresholdCode">
                <option th:each="parameter:${tsm}"  th:text="${parameter}"
                        th:selected="${parameter eq alarmInfo.soeDuration}">
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-3 control-label">报警报文查询名</label>
        <div class="col-lg-6">
            <input type="text" class="form-control" name="alarmCanName" th:value="${alarmInfo.alarmCanName}"/>
        </div>
    </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary">保存</button>
    </div>
</form>

<script>
    initCheck();
</script>